package com.orhon.smartcampus.modules.student.mm;

import java.util.List;

import com.orhon.smartcampus.modules.base.mm.SchoolMapper;
import com.orhon.smartcampus.modules.teacher.mm.TeacherMapper;
import org.mapstruct.InheritConfiguration;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

import com.orhon.smartcampus.modules.base.mm.DictionaryMapper;
import com.orhon.smartcampus.modules.base.mm.LangMapper;
import com.orhon.smartcampus.modules.base.mm.RegionMapper;
import com.orhon.smartcampus.modules.student.entity.EclassHeadteacher;
import com.orhon.smartcampus.modules.student.gqlModel.GQLHeadTeacher;

@Mapper(
        uses = {
                LangMapper.class,
                RegionMapper.class,
                DictionaryMapper.class,
                EclassMapper.class,
                SchoolMapper.class,
                TeacherMapper.class
        }
)
public interface EclassHeadteacherMapper {

    EclassHeadteacherMapper MAPPER = Mappers.getMapper(EclassHeadteacherMapper.class);
    
    @Mapping(source = "id" , target = "id")
    @Mapping(source = "startAt" , target = "start_at")
    @Mapping(source = "endAt" , target = "end_at")
    @Mapping(source = "status" , target = "status")
    @Mapping(source = "reason" , target = "reason")//lang
    @Mapping(source = "transaction" , target = "transaction", qualifiedByName = "str2dic")
    @Mapping(source = "studentEclassByEclassId" , target = "eclass" )
    @Mapping(source = "teacherTInformationByTeacherId" , target = "teacher" )
    @Mapping(source = "baseSchoolsBySchoolId" , target = "school" )
    GQLHeadTeacher mapEntity(EclassHeadteacher entity);
    
    @InheritConfiguration(name = "mapEntity")
    List<GQLHeadTeacher> mapEntityList(List<EclassHeadteacher> entities);



}
